<h2>DESCRIPTION</h2>

<em>d.rast.arrow</em>
is designed to help users better visualize surface water flow direction,
as indicated in an aspect raster map layer.  There are two ways to specify
the aspect layer the program is to use.  The first is to display the aspect
map layer on the graphics monitor before running <em>d.rast.arrow</em>.
The second method involves setting the <em>map</em> parameter
to the name of the desired aspect map.
This allows the arrows to be drawn over any other maps already displayed
on the graphics monitor.
<p>
<em>d.rast.arrow</em> will draw an arrow over each displayed cell
to indicate in which direction the cell slopes. If the aspect
layer has a category value denoting locations of "unknown" aspect,
<em>d.rast.arrow</em> draws a question mark over the displayed cells
of that category.
Cells containing null data will be marked with an "X".
You can disable drawing of null data and unknown aspect values by
setting its color to "<tt>none</tt>".

<p>When specifying the <em>magnitude_map</em> option, arrow lengths
denoting magnitude will be extracted from the cell values of the specified
map. In this case the tail of the arrow will be centered on the source cell.
You may adjust the overall scale using the <em>scale</em> option.
<em>d.rast.arrow</em> will ignore NULL and negative magnitudes, and will
warn you if the debug level is set at 5 or higher. Be aware. If your application
uses negative values for magnitude, you can use
<em><a href="r.mapcalc.html">r.mapcalc</a></em> to prepare the magnitude map to
suit your needs (absolute value, inverted direction and so on).

<p><h2>NOTES</h2>
By default, arrows are drawn at the size of a cell and cannot be seen if
the raster map is relatively close in scale. You can use the <em>skip</em>
option to draw arrows every n-th cell in both directions if you are working
with relatively high resolutions. It may be useful to disable the grid in
this case, which is accomplished by setting its color to "<tt>none</tt>".
<p>For GRASS and Compass type aspect maps, the cell values of the aspect map
will determine the corresponding direction in 360 degrees. ANSWERS type aspect
maps will be plotted in multiples of 15 degrees counterclockwise from east, and
AGNPS and Drainage type aspect maps will be displayed in D8 representation,
i.e. the eight multiples of 45 degrees. Cell values are 1 to 8 clockwise from
north for AGNPS and 1 to 8 counterclockwise from north east for Drainage. See
<em><a href="r.watershed.html">r.watershed</a></em> for more details about the
Drainage aspect.
<p>GRASS aspect maps are measured using Cartesian conventions, i.e. in degrees
counterclockwise from east. e.g.:

<div class="code"><pre>
90  North
180 West
270 South
0,360 East
</pre></div>

They can be created from a raster elevation map with
<em><a href="r.slope.aspect.html">r.slope.aspect</a></em>.
<p>Compass type aspect maps are measured in degrees clockwise from north.
<p>This module uses oceanographic conventions, i.e. arrows point downslope or
direction "to", as opposed to atmospheric conventions (direction "from").


<h2>EXAMPLE</h2>

<!-- TODO: add NC example: where to get U and V maps from? -->

Convert U,V velocity component maps into magnitude,direction maps for use
with <em>d.rast.arrow</em>:

<div class="code"><pre>
r.mapcalc "magnitude = sqrt(U_map^2 + V_map^2)"
r.mapcalc "direction = atan(U_map, V_map)"
d.rast.arrow map=direction type=grass magnitude_map=magnitude skip=3 grid=none
</pre></div>

<!-- Data based on https://grasswiki.osgeo.org/wiki/GRIB -->
<center>
<img src="d_rast_arrow_wind.png"><br>
<i>Sea wind speed (magnitude) and direction shown in the Tasmanian Sea</i>
</center>

<h2>SEE ALSO</h2>

<em>
<a href="d.frame.html">d.frame</a>,
<a href="d.rast.html">d.rast</a>,
<a href="d.rast.edit.html">d.rast.edit</a>,
<a href="d.rast.num.html">d.rast.num</a>,
<a href="g.region.html">g.region</a>,
<a href="r.slope.aspect.html">r.slope.aspect</a>,
<a href="r.watershed.html">r.watershed</a>
</em>


<h2>AUTHORS</h2>

<u>Original author</u><br>
Chris Rewerts<br>
<em>Agricultural Engineering,<br>
Purdue University</em><br><br>
<u>Magnitude and 360 arrow code</u><br>
Hamish Bowman<br>
<em>Department of Marine Science,<br>
University of Otago, New Zealand</em><br><br>
<u>Align grids with raster cells and Drainage aspect type</u><br>
Huidae Cho<br>

<!--
<p>
<i>Last changed: $Date$</i>
-->
